//
//  YZYSDKManager.h
//  YZYSDK
//
//  Created by 赵隆杰 on 2024/6/7.
//

#import <UIKit/UIKit.h>
#import "YZYRoleInfo.h"

NS_ASSUME_NONNULL_BEGIN

@protocol YZYSDKManagerDelegate <NSObject>

@required

/**
 登录回调
 loginResult 0取消 1成功 2失败
 成功时data为
 @{
 @"super_user_id": self.userId,
 @"token": accessToken
};
 */
- (void)yzy_LoginCallBack:(NSInteger)loginResult data:(id)data;

/**
 切换/退出账号回调
 此回调表示平台已完成退出，请勿再调用平台退出接口，否则会造成死循环；
 请在此方法进行游戏退出操作
 */
- (void)yzy_appleChangeAccountOrLogoutCallBack:(NSString *)result;

/**
 支付回调
 payResult 0取消 1成功 2失败
 */
- (void)yzy_applePayCallBack:(NSInteger)payResult data:(id)data;

/**
 上报角色回调
 */
- (void)yzy_updateRoleCallBack:(NSDictionary *)result;

@end

@interface YZYSDKManager : NSObject

/**
 获取SDK实例
 */
+ (instancetype)shareManager;

/**
 设置监听
 */
- (void)yzy_sdkManagerListener:(id)sdkManagerListener;

/**
 显示登录按钮，必须先设置监听
 */
- (void)yzy_showLoginUI;

/**
 提交角色信息（详见YZYRoleInfo.h）
 */
- (void)yzy_submitRoleInfo:(YZYRoleInfo *)roleData;
/**
 退出登录接口
 */
- (void)yzy_logoutPlatform;
/**
 跳转小程序
 */
- (void)yzy_jump_miniPrograms;
/**
 删除账号接口
 */
- (void)yzy_logoutPlatformForAccountDelete;
/**
 苹果支付
 @param goodID 产品ID
 @param payMoney 金额
 @param gameOrderSn 订单号
 @param remark 透传参数
*/
- (void)yzy_applePayWithGoodID:(NSString *)goodID PayMoney:(NSString *)payMoney gameOrderSn:(NSString *)gameOrderSn remark:(NSString *)remark;

/**
 登录状态 YES已登录 NO未登录
 */
@property (nonatomic, assign) BOOL isLogin;

/**
 在有网络后的一些初始化操作
 */
- (void)yzy_AfterNerwork_init;

#pragma mark - UIApplicationDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
- (void)applicationWillResignActive:(UIApplication *)application;
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication*)application;
- (void)applicationWillTerminate:(UIApplication *)application;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo;
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * restorableObjects))restorationHandler;


@end

NS_ASSUME_NONNULL_END
